﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DegradeStore.aspx.cs" Inherits="H2.NET.Web.Pages.SMD.DegradeStore" %>
<%@ Register src="../../Controls/DwzAssessment.ascx" tagname="DwzAssessment" tagprefix="uc" %>
<%@ Register src="../../Controls/DwzAssessmentList.ascx" tagname="DwzAssessmentList" tagprefix="uc" %>
<%@ Register src="../../Controls/AjaxUpload.ascx" tagname="ajaxUpload" tagprefix="uc" %>
<%@ Register src="uc_change_field.ascx" tagname="uc_change_field" tagprefix="uc" %>
<%@ Register src="uc_store_info.ascx" tagname="uc_store_info" tagprefix="uc" %>
<%@ Register src="uc_head.ascx" tagname="uc_head" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
<head id="Head1" runat="server">
    <title>门店关闭、降级</title>
    <link href="<%=Page.ResolveUrl("~/Resource/Css/Style.css")%>" type="text/css" rel="stylesheet" />
    <link href="<%=Page.ResolveUrl("~/Resource/jBox/Blue/jbox.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/Css/validform.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%=Page.ResolveUrl("~/Resource/dwz/js/jquery-1.7.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Common.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/jquery.money.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-2.3.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-zh-CN.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Validform_v5.3.2.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/My97DatePicker/WdatePicker.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.js")%>" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            /* 初始化相关样式、表单验证提示 st */
            $("[datatype='*']").after("<em class='required'>*</em>");
            $("#form1").Validform({
                tipSweep: true,
                tiptype: function (msg, o, cssctl) {
                    if (o.type == 3) {
                        $.jBox.tip(msg, 'info');
                    }
                }
            });
            /* 初始化相关样式、表单验证提示 ed */

            /* 初始化控件提示 st */
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/ajaxtools/handler.ashx?action=get_tips")%>',
                data: { pagename: 'transfer.aspx' },
                dataType: "json",
                cache: false,
                success: function (json) {
                    for (var o in json) {
                        var ControlID = json[o].ControlID;
                        var Content = json[o].Content;
                        $("#" + ControlID).qtip({
                            content: Content
                        });
                    }
                }
            });
            /* 初始化控件提示 ed */

        });

        /* 提交表单 st */
        var close = "";
        function confirmSubmit() {
            <%if(step == "Submit Data" && hasDevice){%>
            if (close == "close")
            {
                $.jBox.tip('系统检测到，该门店有正在使用中的设备，请通知相关人员处理设备！', '提示');
                return false;
            }
            <%}%>
            if (window.confirm("确认要提交吗？")) {
                $.jBox.tip('正在处理，请稍等...', 'loading');
                return true;
            }
            return false;
        }
        /* 提交表单 ed */

        function checkST(st) {
            if (st == 1) {
                close = "";
                $("tbody.jj").show();
            }
            else if (st == 2) {
                close = "close";
                $("tbody.jj").hide();
            }
        } 
    </script>
</head>
<body>
    <div class="flowpage">
    <form id="form" runat="server">
        <!-- 标题 st -->
        <uc1:uc_head ID="uc_head1" runat="server" />
        <!-- 标题 ed -->
         <div class="flowContent">
            <table class="formTable">
                <uc:uc_store_info ID="uc_store_info1" runat="server"/>
                <!-- 字段变更列表 st -->
                <!-- 设备数据列表 -->
                 <tbody id="deviceInfo" runat="server">
                    <tr>
                        <td colspan="6" class="title" >设备信息 <span style="color:#FF3366" id="DeviceError" runat="server">(如果做门店关闭，请先对正在使用设备做处理。)</span></td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <table class="formTable" id="devicelist">
                                <tr>
                                    <th style="text-align:center">设备固定资产号</th>
                                    <th style="text-align:center">美萍号</th>
                                    <th style="text-align:center">调色机型号</th>
                                    <th style="text-align:center">震荡机型号</th>
                                    <th style="text-align:center">电脑型号</th>
                                    <th style="text-align:center">设备状态</th>
                                </tr>
                                <asp:Repeater ID="rpt_devices" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td style="text-align:center"><%#Eval("FullSetSN")%></td>
                                            <td style="text-align:center"><%#Eval("MeiPinNo")%></td>
                                            <td style="text-align:center"><%#Eval("DispenserModel")%></td>
                                            <td style="text-align:center"><%#Eval("ShakerModel")%></td>
                                            <td style="text-align:center"><%#Eval("PcModel")%></td>
                                            <td style="text-align:center"><%#Eval("Status")%></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </td>
                    </tr>
                </tbody>
                <!-- 设备数据列表 -->
                <!-- 门店关闭/降级 -->
                <tbody>
                    <tr>
                        <td class="title" colspan="6">门店关闭/降级</td>
                    </tr>
                    <tr>
                        <th>类型：</th>
                        <td colspan="5">
                            <asp:Literal ID="l_IsDowngraded" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </tbody>

                <!-- 降级 -->
                <tbody class="jj" runat="server" id="jj">
                    <tr>
                        <th>门店降级前类型：</th>
                        <td colspan="5">
                            <asp:Literal ID="l_BeforeDowngradedType" runat="server"></asp:Literal>
                            <asp:CheckBox ID="IsChangeStore" runat="server" Text="修改门店基本信息" />
                        </td>
                    </tr>
                </tbody>

                <!-- 关闭 -->
                <tbody class="gb" runat="server" id="gb">
                    <tr>
                        <th>门店关闭/降级时间：</th>
                        <td>
                            <asp:TextBox ID="tb_CloseDate" runat="server" datatype="*" CssClass="Wdate" onfocus="WdatePicker()"></asp:TextBox>
                            <asp:Literal ID="l_CloseDate" runat="server"></asp:Literal>
                        </td>
                        <th>关店/降级原因归类：</th>
                        <td colspan="3">
                            <asp:DropDownList ID="tb_CloseType" runat="server" datatype="*" nullmsg="请选择关店/降级原因归类">
                            </asp:DropDownList>
                            <asp:Literal ID="l_CloseType" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>原因备注：</th>
                        <td colspan="5">
                            <asp:TextBox ID="tb_CloseReason" datatype="*" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_CloseReason" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </tbody>

            <tbody id="changelogs" runat="server">
                <tr>
                    <th>字段变更列表：</th>
                    <td colspan="5"><uc:uc_change_field ID="uc_change_field1" runat="server" /></td>
                </tr>
            </tbody>
            <!-- 字段变更列表 ed -->

            <!-- 审批列表 st -->
            <tbody id="assessment" runat="server">
                <tr>
                    <td class="title" colspan="6">审批列表</td>
                </tr>
                <tr>
                    <td colspan="6">
                        <uc:DwzAssessmentList ID="DwzAssessmentList1" runat="server" />
                    </td>
                </tr>
            </tbody>
            <!-- 审批列表 ed -->

            <!-- 相关附件 st -->
            <tbody>
                <tr>
                    <th>相关附件：</th>
                    <td colspan="5"><uc:ajaxUpload ID="ajaxUpload1" runat="server" /></td>
                </tr>
            </tbody>
            <!-- 相关附件 ed -->
            
            <!-- 审批意见 st -->
            <tbody>
                <uc:DwzAssessment ID="DwzAssessment1" runat="server" />
            </tbody>
            <!-- 审批意见 ed -->
        </table>
        <!-- 门店主数据变更表单 ed -->

        <!-- 操作按钮 st -->
    <%  if(H2.NET.Common.AksRequest.GetString("showbtn") != "0")
        { %>
        <div style="margin: 5px; padding-bottom: 10px; text-align: center;">
            <asp:Button ID="btn_submit" runat="server" CssClass="u-btn" Text="提交(Submit)" OnClick="btn_submit_Click" OnClientClick="return confirmSubmit();" />
            <input type="button" class="u-btn u-btn-c4" value="关闭(Close)" onclick="custom_close()" />
            <asp:HyperLink ID="hl_ExportPdf" runat="server" Visible="false" Target="_blank" CssClass="u-btn u-btn-c3" style="height:28px; line-height:28px; display:inline-block;">生成(PDF)</asp:HyperLink>
            <asp:Button ID="btn_print" runat="server" CssClass="u-btn u-btn-c2" Text="打印(Print)" OnClientClick="window.print()" Visible="false" />
        </div>
    <%  } %>
        <!-- 操作按钮 ed -->    
             </div>
    </form>
    </div>

</body>
</html>
